gdk/wayland: set requesting surface to xdg-activation
authorJoan Bruguera <joanbrugueram@gmail.com>
Sun, 4 Dec 2022 22:54:51 +0000 (22:54 +0000)
committerJoan Bruguera <joanbrugueram@gmail.com>
Sun, 4 Dec 2022 23:33:34 +0000 (23:33 +0000)
commit43c1a433aa0839826451f71029965d8e359a9178
treeb2c9e5138ce432be59357bae9857e43fc0157bae
parenta9c9678e1f617755368f16424a03ae1f2d2ced4e
gdk/wayland: set requesting surface to xdg-activation

The argument to xdg_activation_token_v1_set_surface is documented to be the
surface requesting the activation, not the surface to be activated, which is
given later when calling xdg_activation_v1_activate.
(c.f. https://gitlab.freedesktop.org/wayland/wayland-protocols/-/commit/36cee4bdbcaf3a75f567315809953b5e21d703da)

Use the same logic as in gdk_wayland_app_launch_context_get_startup_notify_id,
i.e. if we have a surface with focus, set that, otherwise set NULL.

This fixes requesting urgent/focus on wlroots (compositors like Sway, etc.),
which was blocked as the surface requesting the activation didn't have focus.

Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
gdk/wayland/gdksurface-wayland.c